import moment from 'moment';
 function dateFormat(value) {
  return moment(value).format('YYYY-MM-DD HH:mm:ss')
}
//处理参数 如果有时间格式的得处理好 formData:传入的Object 时间:参数名可自定义(暂未自定义)
export  function formatParams(formData){
  let nweParam = {};
  if(formData['dateRange'] && formData['dateRange'].length>0){
    formData['createTime'] =dateFormat(formData['dateRange'][0])
    formData['endTime'] = dateFormat(formData['dateRange'][1])
  }else{
    formData['createTime'] =''
    formData['endTime'] = ''
  }
  
  for(let i in formData){
    if(i!=='dateRange'){
      nweParam[i] = formData[i]
    }
  }
 return nweParam
}